/*
 * Copyright@www.it1997.com.
 * @Author: 陈晓晨
 * @Date: 2020/6/1
 * Description:版权所有 QQ:376231445
 */

package com.it1997.it1997admin.mapper;

import com.it1997.it1997admin.pojo.Role;
import com.it1997.it1997admin.vo.RoleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;
@Mapper
public interface RoleMapper {
    List<Role> getRoles(@Param("userId") Integer userId);

    List<Role> getAllRoles(@Param("index") Integer index, @Param("last") Integer last);

    List<Role> getAllRolesList();
    int addRole(@Param("roleName") String roleName, @Param("description") String description);
    //根据角色名查找角色信息
    Role findRole(@Param("roleName") String roleName);

    int updateRole(@Param("roleVo") RoleVo roleVo);
    int updateRoleStatus(@Param("role") Role role);
    int deleteRoleAllPer(@Param("roleVo") RoleVo roleVo);
    //查询该角色是否拥有该权限
    int findPerById(@Param("s") String s, @Param("id") Integer id);

    int deleteRole(@Param("roleVoList") List<RoleVo> roleVoList);

    Integer getRoleById(@Param("userId") Integer userId);

    Integer getRoleCount();

    RoleVo getRoleByRoleId(@Param("roleId") Integer roleId);

    Integer getSearchRoleCount(@Param("roleVo") RoleVo roleVo);

    List<RoleVo> searchRole(@Param("roleVo") RoleVo roleVo, @Param("index") Integer index, @Param("last") Integer last);
}
